﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Tayninh2011
{
    public sealed partial class FrmStart : RootForm
    {
        private static readonly FrmStart frmStart = new FrmStart();
        private FrmStart()
        {
            InitializeComponent();
        }

        public static FrmStart CallMe
        {
            get { return frmStart; }
        }

        public new void Show()
        {
            if (isShown)
            {
                base.Show();
            }
            else
            {
                base.Show();
                
                isShown = true;
            }
        }
        private static bool isShown = false;

        static FrmStart()
        {

            frmStart.FormClosing += new FormClosingEventHandler(frm_FormClosing);

        }
        private static void frm_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            isShown = false;
            frmStart.Hide();
        }

        private void lblLogin_MouseHover(object sender, EventArgs e)
        {
            lblHover(sender, e);
            lblDescription.Text = "Cần phải có cở sở dữ liệu SDE";
        }

        private void lblLogin_MouseLeave(object sender, EventArgs e)
        {
            lblLeave(sender, e);
            lblDescription.Text = String.Empty;
        }

        private void lblLogin_Click(object sender, EventArgs e)
        {
            FrmLogin.CallMe.Show();
            this.Close();
        }

        private void lblHover(object sender, EventArgs e)
        {
            ((Label)sender).Font = new Font(((Label)sender).Font, FontStyle.Underline);
            ((Label)sender).ForeColor = Color.Red;
        }

        private void lblLeave(object sender, EventArgs e)
        {
            ((Label)sender).Font = new Font(((Label)sender).Font, FontStyle.Regular);
            ((Label)sender).ForeColor = Color.DarkBlue;
        }

        private void lblSeeOnly_MouseLeave(object sender, EventArgs e)
        { 
            lblLeave(sender, e);
            lblDescription.Text = String.Empty;
        }

        private void lblSeeOnly_MouseHover(object sender, EventArgs e)
        {
            lblHover(sender, e);
            lblDescription.Text = "Chỉ xem qua giao diện của phần mềm, không thao tác được. \n (Sử dụng khi không có cơ sở dữ liệu SDE.)";
            
        }

        private void lblSeeOnly_Click(object sender, EventArgs e)
        {

        }
    }
}
